//广告位

import baseRequest from "./base";

export const adReqPath = {
    list: "/p/promotionPosition/list",
    addAndEdit: "/p/promotionPosition/savaOrUpdate",
    findApplyUser: "/p/promotion/commissionInfo/list",
    wdalApply: "/p/wdalApply/list",
};

interface AdProps {
    aliveFlag?: string; //有效标记（0：无效 1：有效）
    commissionRate?: number; //佣金比例（推广者获得佣金比例）
    createDate?: string; //($date-time),创建时间
    mediaId?: string; //媒体ID
    mediaName?: string; //媒体名称
    openId?: string; //绑定用户（微信openid）
    positionId?: string; //推广位ID
    positionName?: string; //推广位名称
    promotionType?: string; //,推广类型（0：淘宝）
    updateDate?: string; //($date-time)更新时间
    uuid?: string;
}

export interface AdApplyProps {
    applyRemark?: string;
    mobile?: string;
    name?: string;
}

export const adGetList = () => baseRequest({url: adReqPath.list});

export const adAdd = (data: AdProps) => baseRequest({url: adReqPath.addAndEdit, data});
export const adEdit = (data: AdProps) => baseRequest({url: adReqPath.addAndEdit, data});
export const adFindApplyUser = (data: AdApplyProps) => baseRequest({url: adReqPath.findApplyUser, data});
//查找申请中用户
export const adFinApplyingUser = (data = {}) =>
    baseRequest({url: adReqPath.findApplyUser, data: {applyStatus: "0", ...data}});
// 超找绑定用户
export const adFindBindUser = (data = {}) =>
    baseRequest({url: adReqPath.findApplyUser, data: {applyStatus: "1", ...data}});

// 提现申请
export const adWdalApplyList = (data = {}) => baseRequest({url: adReqPath.wdalApply, data});
